# ==============================================================================
#
# nda.pm
#
# Account maint Netscape Delegated Admin module
#
# $Id: nda.pm,v 1.1 2005/10/10 23:19:07 dyoung2 Exp $
#
# Darren Young [darren.young@gsb.uchicago.edu]
#
# ==============================================================================
#
# ChangeLog
#
# $Log: nda.pm,v $
# Revision 1.1  2005/10/10 23:19:07  dyoung2
#   * Initial version
#
# ==============================================================================

my  $cvsid   = '$Id: nda.pm,v 1.1 2005/10/10 23:19:07 dyoung2 Exp $';
my  @cvsinfo = split( ' ', $cvsid );
our $NAME    = File::Basename::basename($0);
our $VERSION = $cvsinfo[2];

# ------------------------------------------------------------------------------
#                             B E G I N
# ------------------------------------------------------------------------------
BEGIN {

    # Pragmas
    use strict;

    # "Standard" modules we use
    use FindBin;
    use Config::Simple;
    use lib "$FindBin::Bin/../lib";

    # Standard account maint modules to use
    use logging;
    use errcodes;
    use utils;
    
    # Modules that this module uses
    use LWP;
    use HTTP::Cookies;
    use HTTP::Request::Common;

}


# ------------------------------------------------------------------------------ 
#                             V A R I A B L E S
# ------------------------------------------------------------------------------ 
our $LOGFILE    = "$FindBin::Bin/../log/acctmgr.log" unless($LOGFILE); 
our $CONFIGFILE = "$FindBin::Bin/../etc/acctmgr.cfg" unless($CONFIGFILE);


# ------------------------------------------------------------------------------
#                             C O N F I G   F I L E
# ------------------------------------------------------------------------------
our $CFG = new Config::Simple( filename => $CONFIGFILE ) or die "$!\n" unless($CFG);


sub printSettings {
    my ($fh) = @_;

    my @cfgvars = (
                    'nda.server.host',
                    'nda.server.port',
                    'nda.server.user',
                    'nda.server.pass',
                    'nda.server.encoding',
                    'nda.servlets.auth.url',
                    'nda.servlets.task.url',
                    'nda.servlets.logout.url',
                    'nda.client.cookies.cookiejar',
                    'nda.client.cookies.savecookies',
                    'nda.server.tasks.purgeuser.task',
                    'nda.server.tasks.purgeuser.objecttype',
                    'nda.server.tasks.purgeuser.purgegrace',
                    'nda.server.tasks.purgemailuser.task',
                    'nda.server.tasks.purgemailuser.objecttype',
                    'nda.server.tasks.purgemailuser.strip',
                    'nda.server.tasks.purgrmailuser.purgegrace'
                   );

    foreach my $var (@cfgvars) {
        print "*** " . $CFG->param("$var") . " ***\n";
        #print "Value => " . $CFG->param("$var") . "\n";
        #print "Comment => " . $CFG->param("$var.c") . "\n";
        my $str1 = sprintf("  %15s => %-30s\n", "Value => " , $CFG->param("$var"));
        my $str2 = sprintf("  %15s => %-30s\n", "Comment => " , $CFG->param("$var.c"));
        print $str1;
        print $str2;
    }


    return(PERL_TRUE);
}


1;
